package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CmsCitySysMapper;
import com.ruoyi.system.domain.CmsCitySys;
import com.ruoyi.system.service.ICmsCityServiceSys;

/**
 * 城市Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-26
 */
@Service
public class CmsCityServiceImplSys implements ICmsCityServiceSys
{
    @Autowired
    private CmsCitySysMapper cmsCityMapperSys;

    /**
     * 查询城市
     *
     * @param id 城市主键
     * @return 城市
     */
    @Override
    public CmsCitySys selectCmsCityById(Long id)
    {
        return cmsCityMapperSys.selectCmsCityById(id);
    }

    /**
     * 查询城市列表
     *
     * @param cmsCity 城市
     * @return 城市
     */
    @Override
    public List<CmsCitySys> selectCmsCityList(CmsCitySys cmsCity)
    {
        return cmsCityMapperSys.selectCmsCityList(cmsCity);
    }

    /**
     * 新增城市
     *
     * @param cmsCity 城市
     * @return 结果
     */
    @Override
    public int insertCmsCity(CmsCitySys cmsCity)
    {
        cmsCity.setCreateTime(DateUtils.getNowDate());
        return cmsCityMapperSys.insertCmsCity(cmsCity);
    }

    /**
     * 修改城市
     *
     * @param cmsCity 城市
     * @return 结果
     */
    @Override
    public int updateCmsCity(CmsCitySys cmsCity)
    {
        cmsCity.setUpdateTime(DateUtils.getNowDate());
        return cmsCityMapperSys.updateCmsCity(cmsCity);
    }

    /**
     * 批量删除城市
     *
     * @param ids 需要删除的城市主键
     * @return 结果
     */
    @Override
    public int deleteCmsCityByIds(Long[] ids)
    {
        return cmsCityMapperSys.deleteCmsCityByIds(ids);
    }

    /**
     * 删除城市信息
     *
     * @param id 城市主键
     * @return 结果
     */
    @Override
    public int deleteCmsCityById(Long id)
    {
        return cmsCityMapperSys.deleteCmsCityById(id);
    }
}
